// 导入封装的http
import http from '@/utils/http';

//封装获取轮播图接口并具名导出
// /home/banner
/**
 * 首页-广告区域-小程序
 * @param {Number} distributionSite 1 为首页（默认值）2 为商品分类页
 */
export const getHomeBanner = (distributionSite = 1) => {
    return http({
        url: '/home/banner',
        data: {
            distributionSite
        }
    })
}

/**
 * 获取首页前台分类数据
 */
export const getHomeCategoryMutli = () => {
    return http({
        url:"/home/category/mutli"
    })
}

/**
 * 获取首页热门推荐数据
 */
export const getHomeHotMutli = () => {
    return http({
        url:"/home/hot/mutli"
    })
}

/**
* 获取首页新鲜好物数据
 */
export const getHomeNew = () => {
    return http({
        url:'/home/new'
    })
}

/**
 * 获取首页猜你喜欢数据
 */
export const getHomeGoodsGuessLike = (data) => {
    return http({
        url: '/home/goods/guessLike',
        data
    })
}

/**
 * 
 * @param {string} url //接口url
 * @param {Object} data //传递的参数
 * @returns 
 */
export const getHomeRecommend = (url, data = {}) => {
    return http({
        url,
        data
    })
}